package com.cq.hd.order.api;

import com.cq.hd.common.response.Result;
import com.cq.hd.order.api.dto.OrderItemDto;
import com.cq.hd.order.api.vo.MerchantOrderAmtStatVo;
import com.cq.hd.order.api.vo.OrderItemVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hd-o2o-order-service", contextId = "order-item-api")
public interface TbOrderItemApi {

    // 根据活动id批量获取子订单数据
    @PostMapping("/order/orderItem/listByActiveIds")
    Result<List<OrderItemVo>> listByActiveIds(@RequestBody List<Long> activeIds);

    // 根据条件查询订单项列表
    @GetMapping("/order/orderItem/listByDto")
    Result<List<OrderItemVo>> listByDto(@SpringQueryMap OrderItemDto orderItemDto);

    // 根据核销码获取订单项数据
    @GetMapping("/order/orderItem/getByVerifyCode")
    Result<OrderItemVo> getByVerifyCode(@RequestParam("verifyCode") String verifyCode);

    // 查询商户待结算订单商品本金
    @GetMapping("/order/orderItem/getMerchantWaitSettleAmt")
    Result<MerchantOrderAmtStatVo> getMerchantWaitSettleAmt(@RequestParam("merchantId") Long merchantId);

    // 根据子订单id获取子订单信息
    @GetMapping("/order/orderItem/getById")
    Result<OrderItemVo> getById(@RequestParam("id") Long id);
}
